package com.eastfair.venueservice.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.database.mybatis.typehandler.M9EncryptHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.venueservice.enumeration.RepairReportRepairTypeEnum;
import com.eastfair.venueservice.enumeration.RepairReportRepairStatusEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 报修申请
 * </p>
 *
 * @author dqq
 * @since 2023-04-26
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value="vsm_repair_report",autoResultMap = true)
@ApiModel(value = "RepairReport", description = "报修申请")
@AllArgsConstructor
public class RepairReport extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用（确认状态）：1是 已确认；0否 未确认
     */
    @ApiModelProperty(value = "是否启用（确认状态）：1是 已确认；0否 未确认")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用（确认状态）：1是 已确认；0否 未确认")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 报修单号
     */
    @ApiModelProperty(value = "报修单号")
    @Size(max = 64, message = "报修单号长度不能超过64")
    @TableField(value = "repair_report_number", condition = LIKE)
    @Excel(name = "报修单号")
    private String repairReportNumber;

    /**
     * 报修状态 #{HAS_REPORT:待处理;HAS_DISPATCH:已派单;COMPLETE:工单已完成;FINISH:已结束;CANCEL:已取消}
     */
    @ApiModelProperty(value = "报修状态 #{HAS_REPORT:待处理;HAS_DISPATCH:已派单;COMPLETE:工单已完成;FINISH:已结束;CANCEL:已取消}")
    @TableField(value = "repair_status")
    @Excel(name = "报修状态 #{HAS_REPORT:待处理;HAS_DISPATCH:已派单;COMPLETE:工单已完成;FINISH:已结束;CANCEL:已取消}", replace = {"待处理_HAS_REPORT", "已派单_HAS_DISPATCH", "工单已完成_COMPLETE", "已结束_FINISH", "已取消_CANCEL",  "_null"})
    private RepairReportRepairStatusEnum repairStatus;

    /**
     * 报修类型 #{HOME_REPAIR:主场报修;ONLINE_REPAIR:线上报修；ON_SITE_REPAIR:现场报修}
     */
    @ApiModelProperty(value = "报修类型 #{HOME_REPAIR:主场报修;ONLINE_REPAIR:线上报修；ON_SITE_REPAIR:现场报修}")
    @TableField(value = "repair_type")
    @Excel(name = "报修类型 #{HOME_REPAIR:主场报修;ONLINE_REPAIR:线上报修；ON_SITE_REPAIR:现场报修}", replace = {"主场报修_HOME_REPAIR", "线上报修；ON_SITE_REPAIR:现场报修_ONLINE_REPAIR",  "_null"})
    private RepairReportRepairTypeEnum repairType;

    /**
     * 报修数量
     */
    @ApiModelProperty(value = "报修数量")
    @TableField(value = "repair_num")
    @Excel(name = "报修数量")
    private Integer repairNum;

    /**
     * 报修原因
     */
    @ApiModelProperty(value = "报修原因")
    @Size(max = 255, message = "报修原因长度不能超过255")
    @TableField(value = "repair_reason", condition = LIKE)
    @Excel(name = "报修原因")
    private String repairReason;

    /**
     * 检测结果
     */
    @ApiModelProperty(value = "检测结果")
    @Size(max = 64, message = "检测结果长度不能超过64")
    @TableField(value = "check_result", condition = LIKE)
    @Excel(name = "检测结果")
    private String checkResult;

    /**
     * 报修意见
     */
    @ApiModelProperty(value = "报修意见")
    @Size(max = 300, message = "报修意见长度不能超过300")
    @TableField(value = "repair_opinion", condition = LIKE)
    @Excel(name = "报修意见")
    private String repairOpinion;

    /**
     * 是否需要赔偿 0:否, 1:是
     */
    @ApiModelProperty(value = "是否需要赔偿 0:否, 1:是")
    @TableField(value = "is_need_compensate")
    @Excel(name = "是否需要赔偿 0:否, 1:是")
    private Integer isNeedCompensate;

    /**
     * 报修申请时间
     */
    @ApiModelProperty(value = "报修申请时间")
    @TableField(value = "report_time")
    @Excel(name = "报修申请时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime reportTime;

    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @TableField(value = "exhibition_manage_id")
    @Excel(name = "展会ID")
    private Long exhibitionManageId;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @Size(max = 64, message = "展会名称长度不能超过64")
    @TableField(value = "exhibition_manage_name", condition = LIKE)
    @Excel(name = "展会名称")
    private String exhibitionManageName;

    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    @Size(max = 64, message = "订单编号长度不能超过64")
    @TableField(value = "order_number", condition = LIKE)
    @Excel(name = "订单编号")
    private String orderNumber;

    /**
     * 服务预定ID
     */
    @ApiModelProperty(value = "服务预定ID")
    @TableField(value = "service_booking_id")
    @Excel(name = "服务预定ID")
    private Long serviceBookingId;

    /**
     * 服务名称
     */
    @ApiModelProperty(value = "服务名称")
    @Size(max = 255, message = "服务名称长度不能超过255")
    @TableField(value = "service_name", condition = LIKE)
    @Excel(name = "服务名称")
    private String serviceName;

    /**
     * 服务分类ID
     */
    @ApiModelProperty(value = "服务分类ID")
    @TableField(value = "service_category_id")
    @Excel(name = "服务分类ID")
    private Long serviceCategoryId;

    /**
     * 服务分类名称
     */
    @ApiModelProperty(value = "服务分类名称")
    @Size(max = 255, message = "服务分类名称长度不能超过255")
    @TableField(value = "service_category_name", condition = LIKE)
    @Excel(name = "服务分类名称")
    private String serviceCategoryName;

    /**
     * 服务规格id
     */
    @ApiModelProperty(value = "服务规格id")
    @TableField(value = "service_specs_id")
    @Excel(name = "服务规格id")
    private Long serviceSpecsId;

    /**
     * 服务规格名称
     */
    @ApiModelProperty(value = "服务规格名称")
    @Size(max = 255, message = "服务规格名称长度不能超过255")
    @TableField(value = "service_specs_name", condition = LIKE)
    @Excel(name = "服务规格名称")
    private String serviceSpecsName;

    /**
     * 服务提供系统
     */
    @ApiModelProperty(value = "服务提供系统")
    @Size(max = 64, message = "服务提供系统长度不能超过64")
    @TableField(value = "service_provide_system", condition = LIKE)
    @Excel(name = "服务提供系统")
    private String serviceProvideSystem;

    /**
     * 企业ID
     */
    @ApiModelProperty(value = "企业ID")
    @TableField(value = "company_id")
    @Excel(name = "企业ID")
    private Long companyId;

    /**
     * 公司编码
     */
    @ApiModelProperty(value = "公司编码")
    @Size(max = 64, message = "公司编码长度不能超过64")
    @TableField(value = "company_code", condition = LIKE)
    @Excel(name = "公司编码")
    private String companyCode;

    /**
     * 公司名称
     */
    @ApiModelProperty(value = "公司名称")
    @Size(max = 200, message = "公司名称长度不能超过200")
    @TableField(value = "company_name", condition = LIKE)
    @Excel(name = "公司名称")
    private String companyName;

    /**
     * 公司类型
     */
    @ApiModelProperty(value = "公司类型")
    @Size(max = 64, message = "公司类型长度不能超过64")
    @TableField(value = "company_type", condition = LIKE)
    @Excel(name = "公司类型")
    private String companyType;

    /**
     * 联系人
     */
    @ApiModelProperty(value = "联系人")
    @Size(max = 100, message = "联系人长度不能超过100")
    @TableField(value = "contact", condition = LIKE)
    @Excel(name = "联系人")
    private String contact;

    /**
     * 联系方式
     */
    @ApiModelProperty(value = "联系方式")
    @Size(max = 100, message = "联系方式长度不能超过100")
    @TableField(value = "phone", condition = LIKE,typeHandler = M9EncryptHandler.class)
    @Excel(name = "联系方式")
    private String phone;

    /**
     * 展厅编码
     */
    @ApiModelProperty(value = "展厅编码")
    @Size(max = 64, message = "展厅编码长度不能超过64")
    @TableField(value = "space_code", condition = LIKE)
    @Excel(name = "展厅编码")
    private String spaceCode;

    /**
     * 展厅号
     */
    @ApiModelProperty(value = "展厅号")
    @Size(max = 100, message = "展厅号长度不能超过100")
    @TableField(value = "space_name", condition = LIKE)
    @Excel(name = "展厅号")
    private String spaceName;

    /**
     * 展位号
     */
    @ApiModelProperty(value = "展位号")
    @Size(max = 100, message = "展位号长度不能超过100")
    @TableField(value = "site_name", condition = LIKE)
    @Excel(name = "展位号")
    private String siteName;

    /**
     * 工单状态
     */
    @ApiModelProperty(value = "工单状态")
    @Size(max = 100, message = "工单状态长度不能超过100")
    @TableField(value = "work_order_status", condition = LIKE)
    @Excel(name = "工单状态")
    private String workOrderStatus;

    /**
     * 派单时间
     */
    @ApiModelProperty(value = "派单时间")
    @TableField(value = "dispatch_work_order_time")
    @Excel(name = "派单时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime dispatchWorkOrderTime;

    /**
     * 报修申请归属系统
     */
    @ApiModelProperty(value = "报修申请归属系统")
    @Size(max = 64, message = "报修申请归属系统长度不能超过64")
    @TableField(value = "belong_system", condition = LIKE)
    @Excel(name = "报修申请归属系统")
    private String belongSystem;

    /**
     * 完结备注
     */
    @ApiModelProperty(value = "完结备注")
    @Size(max = 500, message = "完结备注长度不能超过500")
    @TableField(value = "complete_remark", condition = LIKE)
    @Excel(name = "完结备注")
    private String completeRemark;

    /**
     * 是否预定服务 0否1是
     */
    @ApiModelProperty(value = "是否预定服务 0否1是")
    @TableField(value = "is_book_service")
    @Excel(name = "是否预定服务 0否1是")
    private Integer isBookService;

    /**
     * 备注信息
     */
    @ApiModelProperty(value = "备注信息")
    @Size(max = 500, message = "备注信息长度不能超过500")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注信息")
    private String remark;


    @Builder
    public RepairReport(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    String repairReportNumber, RepairReportRepairStatusEnum repairStatus, RepairReportRepairTypeEnum repairType, Integer repairNum, String repairReason, String checkResult, 
                    String repairOpinion, Integer isNeedCompensate, LocalDateTime reportTime, Long exhibitionManageId, String exhibitionManageName, String orderNumber, 
                    Long serviceBookingId, String serviceName, Long serviceCategoryId, String serviceCategoryName, Long serviceSpecsId, String serviceSpecsName, 
                    String serviceProvideSystem, Long companyId, String companyCode, String companyName, String companyType, String contact, 
                    String phone, String spaceCode, String spaceName, String siteName, String workOrderStatus, LocalDateTime dispatchWorkOrderTime, 
                    String belongSystem, String completeRemark, Integer isBookService, String remark) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.repairReportNumber = repairReportNumber;
        this.repairStatus = repairStatus;
        this.repairType = repairType;
        this.repairNum = repairNum;
        this.repairReason = repairReason;
        this.checkResult = checkResult;
        this.repairOpinion = repairOpinion;
        this.isNeedCompensate = isNeedCompensate;
        this.reportTime = reportTime;
        this.exhibitionManageId = exhibitionManageId;
        this.exhibitionManageName = exhibitionManageName;
        this.orderNumber = orderNumber;
        this.serviceBookingId = serviceBookingId;
        this.serviceName = serviceName;
        this.serviceCategoryId = serviceCategoryId;
        this.serviceCategoryName = serviceCategoryName;
        this.serviceSpecsId = serviceSpecsId;
        this.serviceSpecsName = serviceSpecsName;
        this.serviceProvideSystem = serviceProvideSystem;
        this.companyId = companyId;
        this.companyCode = companyCode;
        this.companyName = companyName;
        this.companyType = companyType;
        this.contact = contact;
        this.phone = phone;
        this.spaceCode = spaceCode;
        this.spaceName = spaceName;
        this.siteName = siteName;
        this.workOrderStatus = workOrderStatus;
        this.dispatchWorkOrderTime = dispatchWorkOrderTime;
        this.belongSystem = belongSystem;
        this.completeRemark = completeRemark;
        this.isBookService = isBookService;
        this.remark = remark;
    }

}
